<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<head>
  <base href="<%=basePath%>">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>修改密码</title>
  <link rel="stylesheet" type="text/css" href="css/css.css" />
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script>
    function update_password(e){
      var formObject = {};
      var formArray =$("#form1").serializeArray();
      $.each(formArray,function(i,item){
        formObject[item.name] = item.value;
      });
      $.ajax({
        url:'Enterprise_info/Update_password',
        headers: {
          'Content-Type': 'application/json;charset=utf-8',
        },
        type:'POST',
        data:JSON.stringify(formObject),
        dataType: "json",
        success:function(data){
          if(data.code=='1001'){
            alert("修改成功,请重新登录");
            window.location.href="jsp/Enterprise_login.jsp";
          }
          else {
            alert(data.message);
            window.history.go(-1);
          }
        }
      })
    }
  </script>
</head>
<body>
<%
  String comAccount = request.getParameter("comAccount");
%>
<div id="pageAll">
  <div class="pageTop">
    <div class="page">
      <img src="img/coin02.png" />&nbsp;修改密码
    </div>
  </div>
  <div class="page ">
    <!-- 修改密码页面样式 -->
    <form id="form1">
      <div class="bacen">
        <div class="bbD">账号：<input type="text" name="mobile" value="<%=comAccount%>" readonly style="border:0;"><hr></div>
        <div class="bbD">
          &nbsp;&nbsp;&nbsp;&nbsp;输入旧密码：<input type="password" class="input3" name="oldPassword"
                                               id="pwd1" /> <img class="imga"
                                                                 src="img/ok.png" /><img class="imgb" src="img/no.png" />
        </div>
        <div class="bbD">
          &nbsp;&nbsp;&nbsp;&nbsp;输入新密码：<input type="password" class="input3" name="newPassword"
                                               id="pwd2" /> <img class="imga"
                                                                 src="img/ok.png" /><img class="imgb" src="img/no.png" />
        </div>
        <div class="bbD">
          再次确认密码：<input type="password" class="input3" name="newPasswordq"
                        id="pwd3" /> <img class="imga" src="img/ok.png" /><img
                class="imgb" src="img/no.png" />
        </div>
        <div class="bbD">
          <p class="bbDP">
            <span class="btn_ok btn_yes" onclick="update_password()"><input type="hidden" />提交</span>
            <span class="btn_ok btn_no"><a href="jsp/enterprise.jsp?comAccount=<%=comAccount%>">返回</a></span>
          </p>
        </div>
      </div>
    </form>
    <!-- 修改密码页面样式end -->
  </div>
</div>
</body>
<script type="text/javascript">
</script>
</html>